class Out {
    public int data1 = 1;
    public static int data2 = 2;
    private int data3 = 3;

    static class InClass {
        public int data4 = 4;
        public static int data5 = 5;
        private int data6 = 6;

        public void test() {
            Out out = new Out();
            System.out.println(out.data1);
            System.out.println(data2);//只能调用外部类的静态成员或方法
            System.out.println(out.data3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println("InClass::test()");
        }
    }

    public void test() {
        System.out.println("Out::test()");
    }
}

interface IA {
    void test();
}

public class Test {
    public static void main(String[] args) {
        new IA() {
            @Override
            public void test() {
                System.out.println("这是重写了接口的方法！");
            }
        };

        IA ia = new IA() {
            @Override
            public void test() {
                System.out.println("这是重写了接口的方法！");
            }
        };
        ia.test();
    }
    public static void main1(String[] args) {
        //Out out = new Out();
        //out.test();
        Out.InClass inClass = new Out.InClass();
        //调用其静态内部类
        inClass.test();
    }
}
